-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-65454: avoid triggering call to a PropertyMock in NonCallableMock.__setattr__ #120019
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Do you consider this a bugfix or a feature improvement?
Thanks. I believe this is a bug (it was filed as one) since it should be expected that a |
…eMock.__setattr__ (pythonGH-120019) (cherry picked from commit 9e9ee50) Co-authored-by: blhsing <[email protected]>
…eMock.__setattr__ (pythonGH-120019) (cherry picked from commit 9e9ee50) Co-authored-by: blhsing <[email protected]>
GH-120336 is a backport of this pull request to the 3.13 branch. |
GH-120337 is a backport of this pull request to the 3.12 branch. |
…eMock.__setattr__ (python#120019)
…eMock.__setattr__ (python#120019)
…eMock.__setattr__ (python#120019)
Avoid triggering call to a
PropertyMock
inNonCallableMock.__setattr__
Previously attaching a
PropertyMock
to a mock object would trigger a call to the property mock due to a recursive__setattr__
call.This is now fixed by setting the given property mock as an attribute of the hosting mock directly in its
__dict__
instead.